 <link href="/stylesheets/bootstrap-datetimepicker.min.css" rel="stylesheet" media="screen">
<div class="container-fluid">

                <!-- Page Heading -->
                <div class="row">
                    <div class="col-lg-12">
                        <ol class="breadcrumb" style="position:relative;margin-top:5px;margin-bottom:5px;">
                            <li>
                                <i class="fa fa-cube"></i>  菜单管理
                            </li>
                            <li class="active">菜式管理
                            </li>
                            	
                          
                		<div style="position:absolute;right:2%;top:23%;cursor:pointer;">
                			<i class="fa fa-plus-circle fa-lg"  onclick="window.location.href='/cuisine/addinit'"></i> 
                		</div>

                        </ol>
                        <div class="table-responsive" >
                         <table class="table table-hover table-striped" style="margin-bottom:10px;">
                        	<tr>
	        <td width="95%">
                    <input class="form-control" type="text"  id="cuisinename" value="<%=cuisinename %>">
      
	        </td>
	       
	                <td width="5%">
           <button class="btn btn-default" type="button" onclick="javascript:query(1);"><i class="fa fa-search"></i></button>
          
           </td>


        </tr>
        </table>
                        </div>
								  
							
                    </div>
                </div>
                <div class="row">
                    <div class="col-lg-12">
                        <div class="table-responsive">
                            <table class="table table-hover table-striped">
                                <thead>
                                    <tr>
                                   		 <th>名称</th>
                                        <th>时间</th>
                                        <th></th>
                                    </tr>
                                </thead>
                                <tbody>
<% cuisines.forEach(function(cuisine, index) { %>
	        <tr>
	        <td><i class="fa fa-edit" onClick="window.location.href='/cuisine/editinit?id=<%=cuisine._id%>'" style="cursor:pointer;"></i><%=cuisine.name %></td>
            <td><%= moment(cuisine.time).format('YYYY-MM-DD HH:mm:ss') %></td>
            <td>
            <i class="fa fa-minus-circle" onClick="del('<%=cuisine._id %>')" style="cursor:pointer;"></i> 
          
           </td>
        </tr>

<%}) %>                             
</tbody>
                            </table>
                        </div>
                    </div>
                </div>
<nav style="text-align:right;">
      <ul class="pagination">
        <li  <% if(page==1||totalPage==0){%>
         class="disabled"><a href="javascript:;" aria-label="Previous">
          <%}else{%>
          ><a href="javascript:query(<%=(page-1)%>)" aria-label="Previous">
           <%}%>
            <span aria-hidden="true">«</span>
          </a>
        </li>
        <% for(var i=1;i<=totalPage;i++){ %>
        	<% if(i==page){%>
        		 <li class="active"><a href="javascript:void"><%=i %></a></li>
        	<%}else{%>
       			 <li><a href="javascript:query(<%=(i)%>)"><%=i %></a></li>
       		<%}%>
        <%} %>   
        <li <% if(page==totalPage||totalPage==0){%>
         class="disabled"><a href="javascript:;" aria-label="Next">
          <%}else{%>
          	> <a href="javascript:query(<%=(parseInt(page)+1)%>)" aria-label="Next">
          <%}%>
            <span aria-hidden="true">»</span>
          </a>
        </li>
      </ul>
    </nav>
            </div>

            
<script>
    
    
	
	function del(id){
		if(confirm("确认删除该条记录?")){
			window.location.href='/cuisine/del?id='+id;
		}
		return false;
	}

	function query(page){
		var cuisinename=$("#cuisinename").val();
		window.location.href='/cuisine/init?page='+page+"&cuisinename="+cuisinename;
	}
	
	
	

</script>